package com.softcits.auth2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;

@Service("softcitsUser")
public class UserDetailsServiceImpl implements UserDetailsService {

    @Autowired
    private PasswordEncoder encoder;
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        
        SoftCitsUser user = new SoftCitsUser();
        user.setUserPassword(encoder.encode("123456"));
        user.setLoginName("admin");
        user.setUserEmail("910150090@qq.com");
        user.setUserPhone("15640826542");
        user.setRemember(true);
        return user;
    }

}
